<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditAnnounceTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_idAnnounce}" for="idAnnounce" />
                    <h:inputText id="idAnnounce" value="#{announceController.selected.idAnnounce}" title="#{bundle.EditAnnounceTitle_idAnnounce}" required="true" requiredMessage="#{bundle.EditAnnounceRequiredMessage_idAnnounce}"/>
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_startDate}" for="startDate" />
                    <h:inputText id="startDate" value="#{announceController.selected.startDate}" title="#{bundle.EditAnnounceTitle_startDate}" required="true" requiredMessage="#{bundle.EditAnnounceRequiredMessage_startDate}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_finishDate}" for="finishDate" />
                    <h:inputText id="finishDate" value="#{announceController.selected.finishDate}" title="#{bundle.EditAnnounceTitle_finishDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_type}" for="type" />
                    <h:inputText id="type" value="#{announceController.selected.type}" title="#{bundle.EditAnnounceTitle_type}" required="true" requiredMessage="#{bundle.EditAnnounceRequiredMessage_type}"/>
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_status}" for="status" />
                    <h:inputText id="status" value="#{announceController.selected.status}" title="#{bundle.EditAnnounceTitle_status}" required="true" requiredMessage="#{bundle.EditAnnounceRequiredMessage_status}"/>
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_description}" for="description" />
                    <h:inputText id="description" value="#{announceController.selected.description}" title="#{bundle.EditAnnounceTitle_description}" required="true" requiredMessage="#{bundle.EditAnnounceRequiredMessage_description}"/>
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_price}" for="price" />
                    <h:inputText id="price" value="#{announceController.selected.price}" title="#{bundle.EditAnnounceTitle_price}" required="true" requiredMessage="#{bundle.EditAnnounceRequiredMessage_price}"/>
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_idProperty}" for="idProperty" />
                    <h:selectOneMenu id="idProperty" value="#{announceController.selected.idProperty}" title="#{bundle.EditAnnounceTitle_idProperty}" required="true" requiredMessage="#{bundle.EditAnnounceRequiredMessage_idProperty}">
                        <f:selectItems value="#{propertyController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditAnnounceLabel_winningIdOffer}" for="winningIdOffer" />
                    <h:selectOneMenu id="winningIdOffer" value="#{announceController.selected.winningIdOffer}" title="#{bundle.EditAnnounceTitle_winningIdOffer}" >
                        <f:selectItems value="#{offerController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{announceController.update}" value="#{bundle.EditAnnounceSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditAnnounceViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{announceController.prepareList}" value="#{bundle.EditAnnounceShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditAnnounceIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
